<template>
  <el-dialog
    center
    :visible="dialogVisible"
    width="80%"
    title=""
    append-to-body
    :before-close="handleClose"
    @closed="handleClose"
    :close-on-click-modal="false"
  >
    <el-tabs
      type="border-card"
      v-model="activeName"
    >
      <el-tab-pane name="first">
        <span slot="label">正算</span>
        <Calculation type="front" :business-form="params"></Calculation>
      </el-tab-pane>

      <el-tab-pane name="second">
        <span slot="label">反算</span>
        <Calculation type="reverse" :business-form="params"></Calculation>
      </el-tab-pane>
    </el-tabs>
  </el-dialog>
</template>

<script>
import Calculation from './components/calculation'

export default {
  name: "Rent",
  dicts: [],
  components: {
    Calculation,
  },
  data() {
    return {
      // 默认展示第一页的tab内容
      activeName: 'first',
      dialogVisible: false,
      params: {}
    };
  },
  computed: {

  },
  created() {

  },
  methods: {
    async sync(params) {
      this.dialogVisible = true;
      this.activeName = 'first';
      this.params = params
    },
    handleClose() {
      this.dialogVisible = false;
    },
  }
};
</script>
